
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>表单</title>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    <link rel="stylesheet" href="__PUBLIC__/static/css/style.css">
    <link rel="icon" href="__PUBLIC__/static/image/code.png">
</head>
<body class="body">


<form class="layui-form" action="" method="post" id="testform">

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
               <input type="type" name="nickname" lay-verify="" autocomplete="off" class="layui-input" value="{$user.user_name}" disabled="">
            </div>
        </div>
    </div>

      <div class="layui-form-item">
        <label class="layui-form-label">权限角色</label>
        <div class="layui-input-block">
        {foreach $tname as $key=>$vo}
          <input type="checkbox" name="role[]" lay-skin="primary" value="{$vo.id}" title="{$vo.title}" {notempty name="$vo.checked"}checked{/notempty}{$vo.status ? "" : "disabled"}>
        {/foreach}
        </div>
      </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
{notempty name="$user"}
  <input type="hidden" name="id" value="{$user.id}">
{/notempty}    
</form>
<!-- 通用-970*90 -->


<script src="__PUBLIC__/layui/layui.js" charset="utf-8"></script>
<script src="__ADMIN__/js/comm.js" charset="utf-8"></script>
<script>
    layui.use(['layer','form','admin'], function(){
        var layer = layui.layer
            ,$ = layui.jquery
            ,form = layui.form
            ,admin = layui.admin;

        form.on('submit(demo1)', function(data){
            admin.action('{:url('admin/User/auth')}',$("#testform").serialize());
            return false;
        });

    });
</script>
</body>
</html>